<template>
    <lazyCommonHeader>
      HOME页
    </lazyCommonHeader>
    <!-- 会刷新页面 -->
    <a href="/users">go_users</a>
    <!-- 不会刷新页面 -->
    <nuxt-link to="/users?id=123">go_users2</nuxt-link>

    <el-button @click="goUsers" type="success" size="large"
      >go_users3</el-button
    >

    <div class="c-primary h-30">el-inputval---{{ inputVal }}</div>
    <el-input v-model="inputVal"></el-input>
    <el-button type="warning">
      gahha
    </el-button>
</template>
<script setup>
// 跳转
const router = useRouter();
const goUsers = () => {
  router.push({
    path: "/users",
    query: {
      id: 123,
    },
  });
};

const inputVal = ref("");

// 写在middleware中的需要在每个路由下单独引入来使用
definePageMeta({
  middleware:['auth']
})
</script>
<style scoped>
.home {
  color: red;
}
</style>
